package com.itheima.health.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.health.pojo.CheckItem;
import com.itheima.health.pojo.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface RoleMapper extends BaseMapper<Role> {

    @Delete("delete from t_role_permission where role_id=#{id}")
    void deletePermissionIdsByRoleId(@Param("id") Integer id);

    @Insert("insert  into  t_role_permission values(#{rid},#{permissionId})")
    void addRoleIdAndPermissionId(@Param("rid") Integer rid, @Param("permissionId") Integer permissionId);

    @Select("select  permission_id from  t_role_permission where role_id=#{id}")
    int[] findpermissionInfoByRoleId(@Param("id") int id);
}
